package com.codingman.springjdbcdemo1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo1 {
	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

		EmployeeDao1 dao = (EmployeeDao1) ctx.getBean("dao1");
//		int status = dao.save(new Employee(101, "Anna", 35000));
//		System.out.println(status);
//
//		int status2 = dao.update(new Employee(101, "James", 15000));
//		System.out.println(status2);

		Employee e = new Employee();
		e.setId(101);
		int status3 = dao.delete(e);
		System.out.println(status3);
	}
}